<?php
/** Constants related to Dataz manager state machine
 *  This collection of functions (libary) is licensed under GPL2.
 *  See LICENSE or www.gnu.org for more details.
 *
 *  @author Jyry Kuukkanen
 *  $Id: dzsmconst.php 595 2006-04-03 16:00:47Z jyry $
 */

/* Define return codes for state machine */
define(DZ_MANAGER_ERROR, 0); /* An error occurred. The session terminates */
define(DZ_MANAGER_SEND_SCREEN, 1); /* Send the screen for the client */
define(DZ_MANAGER_END, 2); /* Session was finished */

/* Define Dataz states. */
/* XXX document the purpose of *from* and *go* states */
define(DZ_STATE_UNDEFINED, 0); /* Undefined state */
define(DZ_STATE_GO_INITIAL, 1); /* Construct the initial view */
define(DZ_STATE_FROM_INITIAL, 2); /* Coming from the initial state. No
                                     view open */
define(DZ_STATE_GO_QUERY_LOOP, 3); /* Going to query mode */
define(DZ_STATE_FROM_QUERY_LOOP, 4); /* Coming from the client side in the 
                                   query mode */
define(DZ_STATE_START_NEW, 5); /* Starting to add new row */
define(DZ_STATE_START_EDIT, 6); /* Going to edit a row */

define(DZ_STATE_GO_EDIT_LOOP, 7); /* Loop again. Both edit and new modes. */
define(DZ_STATE_FROM_EDIT_LOOP, 8); /* Coming from the client side in the 
                                       edit mode */
define(DZ_STATE_FROM_NEW_LOOP, 9); /* Coming from the client side in the 
                                      new mode */

define(DZ_STATE_GO_BROWSE, 10); /* Going to browse mode */
define(DZ_STATE_FROM_BROWSE, 11); /* Coming from the client side in the 
                                    browse mode */
define(DZ_STATE_GO_LOOK_UP, 12); /* Going to sLook up */
define(DZ_STATE_FROM_LOOK_UP, 13); /* Coming from look up */

define(DZ_STATE_GO_ORDER_BY, 14); /* Going to set the order by columns */
define(DZ_STATE_FROM_ORDER_BY, 15); /*Coming from setting the order by columns*/

define(DZ_STATE_ADD_VIEW, 16); /*Add a new view to session*/

define(DZ_STATE_KILL_VIEW, 17); /* Kill the current view */
define(DZ_STATE_CHANGE_VIEW, 18); /* Change to the stored view */
define(DZ_STATE_ACTIVATE_VIEW, 19); /* Activate view */

define(DZ_STATE_BROWSE_PREVIOUS, 20); /* Go to the previous data in the browse list */
define(DZ_STATE_BROWSE_NEXT, 21); /* Go to the following data in the browse list */

define(DZ_STATE_START_QUERY, 22); /* Initialize query mode */

define(DZ_STATE_CANCEL_EDIT, 23); /* Edit was canceled. -> back to browse */
define(DZ_STATE_COMMIT_EDIT, 24); /* Commit edited data. */

define(DZ_STATE_INIT_BROWSE, 25); /* Init browse mode. */

define(DZ_STATE_GO_DIALOG, 27); /* Go to dialog view */

define(DZ_STATE_HANDLE_EVENT, 29); /* Handle the event occurred at client side*/

define(DZ_STATE_INITIAL, 30); /* State that starts state machine*/

/** Following views are related to sub views */
define(DZ_STATE_FROM_SUB_VIEW, 31); /** Returning from client */
define(DZ_STATE_RETURN_TO_PARENT_VIEW, 32); /** Return to the underlying view  */

define(DZ_STATE_ADD_LINE, 35); /** Add new line to group.  */
define(DZ_STATE_INSERT_LINE, 36); /** Insert line in the group after ctrl-ins.*/
define(DZ_STATE_DEL_LINE, 37); /** Delete line from group after ctrl-del.  */
define(DZ_STATE_SHOW_HELP, 38); /** Show help screen for the form  */

define(DZ_STATE_DEL_ROW, 39); /** Delete a row from db */
define(DZ_STATE_CHANGE_ORDER, 40); /** Change the order of rows when browsing */

define(DZ_STATE_START_PICK_UP, 41); /** Start pick up sub view sequence
                                        (query, browse) */
define(DZ_STATE_FINISH_PICK_UP, 42); /** Finish look up */

define(DZ_STATE_CHANGE_BROWSE_MODE, 43); /** Changes the browse mode from list
                                            to browse and vice versa. */
define(DZ_STATE_JUMP_TO_BROWSE_POS, 44); /** Move the current browse row */

define(DZ_STATE_PRODUCE_OUTPUT, 45); /** Prodece the output code */
define(DZ_STATE_FINISH, 46); /** Finish the state machine */

define(DZ_STATE_RECOVER_ERROR, 47); /** Check for errors and try to recover
                                       from them */

define(DZ_STATE_VALIDATE_FIELD, 48); /* Validate field that triggered the
                                        validate event */

define(DZ_STATE_RETURN_QUERYING, 49); /* Return querying. After pick erase
                                        pick form. */
define(DZ_STATE_UPD_FETCH_FIELD, 50); /* Update single pseudo field (fetch) */

define(DZ_STATE_INSERT_FORM, 51); /* Insert new form into view */
define(DZ_STATE_COMMIT_PSEUDO_FORM, 52); /* handle pseudoform data */
define(DZ_STATE_SUSPEND, 53);           /* Suspend the session */
define(DZ_STATE_CHANGE_PAGE, 54);       /* Change the forms page */

define(DZ_STATE_HACKER_IN, 100); /* The received user id didn't
                                  own the session */
define(DZ_STATE_TERMINATE_SESSION, 101); /* The session terminated peacefully */

?>
